package com.hundsun.aitest.common;

public enum CasePriorityEnum {
    P0("P0", "冒烟级用例，对应缺陷致命或严重"),
    P1("P1", "高级别用例，对应缺陷等级严重"),
    P2("P2", "中级别用例，对应缺陷等级一般"),
    P3("P3", "低级别用例，对应缺陷等级小缺陷、优化");

    private final String code;
    private final String description;

    CasePriorityEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // 检查给定的字符串是否是有效的优先级代码
    public static boolean isValidPriorityCode(String code) {
        for (CasePriorityEnum priority : CasePriorityEnum.values()) {
            if (priority.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}
